<#
开发模板生成（原生 PowerShell）
用途：根据语言与风格复制 templates 目录到目标位置。
用法：
  pwsh -File scripts/windows/dev-templates.ps1 -lang python -style mimic [-target .tmp/scaffold_python]
#>
param(
  [Parameter(Mandatory=$true)][string]$lang,
  [string]$style = 'mimic',
  [string]$target
)

$WindowsDir = Split-Path -Parent $PSCommandPath
$ScriptsDir = Split-Path -Parent $WindowsDir
$RepoDir = Split-Path -Parent $ScriptsDir

if (-not $target) { $target = Join-Path $RepoDir (".tmp/scaffold_" + $lang) }
$src = Join-Path $RepoDir ("templates/" + $lang)
if (!(Test-Path $src)) { Write-Error "不存在的语言模板：$src"; exit 2 }
New-Item -ItemType Directory -Force -Path $target | Out-Null
Copy-Item -Path $src/* -Destination $target -Recurse -Force
Write-Host "已生成模板：$target (lang=$lang, style=$style)"
exit 0
